\(\int \cot (d (a+b \log (c x^n))) \, dx\) [212]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 13, antiderivative size = 66 \[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=i x-2 i x \operatorname {Hypergeometric2F1}\left (1,-\frac {i}{2 b d n},1-\frac {i}{2 b d n},e^{2 i a d} \left (c x^n\right )^{2 i b d}\right ) \]

[Out]

I*x-2*I*x*hypergeom([1, -1/2*I/b/d/n],[1-1/2*I/b/d/n],exp(2*I*a*d)*(c*x^n)^(2*I*b*d))

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {4590, 4592, 470, 371} \[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=i x-2 i x \operatorname {Hypergeometric2F1}\left (1,-\frac {i}{2 b d n},1-\frac {i}{2 b d n},e^{2 i a d} \left (c x^n\right )^{2 i b d}\right ) \]

[In]

Int[Cot[d*(a + b*Log[c*x^n])],x]

[Out]

I*x - (2*I)*x*Hypergeometric2F1[1, (-1/2*I)/(b*d*n), 1 - (I/2)/(b*d*n), E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d)]

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p + 1) + 1))), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 4590

Int[Cot[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[x/(n*(c*x^n)^(1/n)), Subst[Int[x
^(1/n - 1)*Cot[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[{a, b, c, d, n, p}, x] && (NeQ[c, 1] || NeQ[n,
1])

Rule 4592

Int[Cot[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*((-I - I*E^(2*I*a*d)
*x^(2*I*b*d))/(1 - E^(2*I*a*d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (x \left (c x^n\right )^{-1/n}\right ) \text {Subst}\left (\int x^{-1+\frac {1}{n}} \cot (d (a+b \log (x))) \, dx,x,c x^n\right )}{n} \\ & = \frac {\left (x \left (c x^n\right )^{-1/n}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1}{n}} \left (-i-i e^{2 i a d} x^{2 i b d}\right )}{1-e^{2 i a d} x^{2 i b d}} \, dx,x,c x^n\right )}{n} \\ & = i x-\frac {\left (2 i x \left (c x^n\right )^{-1/n}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1}{n}}}{1-e^{2 i a d} x^{2 i b d}} \, dx,x,c x^n\right )}{n} \\ & = i x-2 i x \operatorname {Hypergeometric2F1}\left (1,-\frac {i}{2 b d n},1-\frac {i}{2 b d n},e^{2 i a d} \left (c x^n\right )^{2 i b d}\right ) \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(141\) vs. \(2(66)=132\).

Time = 8.06 (sec) , antiderivative size = 141, normalized size of antiderivative = 2.14 \[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=x \left (-\frac {e^{2 i d \left (a+b \log \left (c x^n\right )\right )} \operatorname {Hypergeometric2F1}\left (1,1-\frac {i}{2 b d n},2-\frac {i}{2 b d n},e^{2 i d \left (a+b \log \left (c x^n\right )\right )}\right )}{-i+2 b d n}-i \operatorname {Hypergeometric2F1}\left (1,-\frac {i}{2 b d n},1-\frac {i}{2 b d n},e^{2 i d \left (a+b \log \left (c x^n\right )\right )}\right )\right ) \]

[In]

Integrate[Cot[d*(a + b*Log[c*x^n])],x]

[Out]

x*(-((E^((2*I)*d*(a + b*Log[c*x^n]))*Hypergeometric2F1[1, 1 - (I/2)/(b*d*n), 2 - (I/2)/(b*d*n), E^((2*I)*d*(a
+ b*Log[c*x^n]))])/(-I + 2*b*d*n)) - I*Hypergeometric2F1[1, (-1/2*I)/(b*d*n), 1 - (I/2)/(b*d*n), E^((2*I)*d*(a
 + b*Log[c*x^n]))])

Maple [F]

\[\int \cot \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )d x\]

[In]

int(cot(d*(a+b*ln(c*x^n))),x)

[Out]

int(cot(d*(a+b*ln(c*x^n))),x)

Fricas [F]

\[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \cot \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right ) \,d x } \]

[In]

integrate(cot(d*(a+b*log(c*x^n))),x, algorithm="fricas")

[Out]

integral(cot(b*d*log(c*x^n) + a*d), x)

Sympy [F]

\[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int \cot {\left (d \left (a + b \log {\left (c x^{n} \right )}\right ) \right )}\, dx \]

[In]

integrate(cot(d*(a+b*ln(c*x**n))),x)

[Out]

Integral(cot(d*(a + b*log(c*x**n))), x)

Maxima [F]

\[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \cot \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right ) \,d x } \]

[In]

integrate(cot(d*(a+b*log(c*x^n))),x, algorithm="maxima")

[Out]

integrate(cot((b*log(c*x^n) + a)*d), x)

Giac [F]

\[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \cot \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right ) \,d x } \]

[In]

integrate(cot(d*(a+b*log(c*x^n))),x, algorithm="giac")

[Out]

integrate(cot((b*log(c*x^n) + a)*d), x)

Mupad [F(-1)]

Timed out. \[ \int \cot \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int \mathrm {cot}\left (d\,\left (a+b\,\ln \left (c\,x^n\right )\right )\right ) \,d x \]

[In]

int(cot(d*(a + b*log(c*x^n))),x)

[Out]

int(cot(d*(a + b*log(c*x^n))), x)